<?php
// +----------------------------------------------------------------------
// | FastXCMS [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.fastxcms.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
namespace plugins\custom_admin_login;

use cmf\lib\Plugin;
use think\Db;

class CustomAdminLoginPlugin extends Plugin
{
	public function __construct()
    {
        parent::__construct();
		
		// 授权允许调用模块参数
		define('IN_MOD', true);
		
		// 初始化安装模块参数
		global $configinfo;
		$configinfo['installmodule'] = "login";
		
		// 目前支持：pc/mobile/xcx/admin/supplier
		$modulepara = 'pc';require(PLUGINS_PATH . 'modulepara/config/modulepara.php');
    }
	public function smarty_assign($varname,$var)
	{		
		$this->assign($varname, $var);
	}

    public $info = [
        'name'        => 'CustomAdminLogin',
        'title'       => '自定义后台登录页',
        'description' => '自定义后台登录页',
        'status'      => 1,
        'author'      => 'FastXCMS',
        'version'     => '1.0'
    ];

    public $hasAdmin = 0;//插件是否有后台管理界面

    // 插件安装
    public function install()
    {
        return true;//安装成功返回true，失败false
    }

    // 插件卸载
    public function uninstall()
    {
        return true;//卸载成功返回true，失败false
    }

    public function adminLogin()
    {
        return $this->fetch('widget');
    }

}